//获取推荐页面数据
import axios from 'axios';
import {commomParams,recommendData} from "./config"

export function getRecommend(){
  let data = {
    '-': 'recom6845863882843009',
    sign: 'zzaac9md0dwuxff15c4441255ee9ef959d8dacccc3f88',
  };
  let urldata = Object.assign({},commomParams,data,recommendData)
  return axios.get('/api/recommend', {
    params: urldata
  }).then((res) => {
    return Promise.resolve(res.data)
  })
}


export function getRecommendList(){
  let data = {
    loginUin: 0,
    picmid: 1,
    rnd: 0.03684539904322115,
    g_tk_new_20200303: 5381,
    categoryId: 10000000,
    sortId: 5,
    sin: 0,
    ein: 29
  }
  let urldata = Object.assign({},commomParams,data)
  return axios.get('/api/recommenglist',{
    params:urldata
  }).then((res)=>{
    return Promise.resolve(res.data)
  })
}
export function getSongList(dissid){
  const url = "/api/getdisclist";
  let data = {
    type: 1,
    json: 1,
    utf8: 1,
    onlysong: 0,
    new_format: 1,
    disstid: dissid,
    g_tk_new_20200303: 5381,
    loginUin: 240046220,
  }
  let urldata = Object.assign({},commomParams,data);
  return axios.get(url,{params:urldata}).then((res)=>{
    return Promise.resolve(res.data.cdlist[0]);
  })
}
    
